package com.wunu.smartlock1.model;

/**
 * Created by admin on 2018/4/22.
 */

public class AuthorizedRecordVo {
    private String authorizedCode;//认证编码
    private String authorizedName;//认证成员名称
    private String authorizedPicUrl;//成员头像图片路径
    private int state;//连接状态
    private String lockStatus;//连接状态描述
    private int memberType;//成员类型(0:认证成员 1.临时秘钥)
    private String lockTime;//开锁时间

    public String getAuthorizedCode() {
        if(memberType == 0){
            return "家庭成员";
        }
        return authorizedCode;
    }
    public void setAuthorizedCode(String authorizedCode) {
        this.authorizedCode = authorizedCode;
    }
    public String getAuthorizedName() {
        return authorizedName;
    }
    public void setAuthorizedName(String authorizedName) {
        this.authorizedName = authorizedName;
    }
    public String getAuthorizedPicUrl() {
        return authorizedPicUrl;
    }
    public void setAuthorizedPicUrl(String authorizedPicUrl) {
        this.authorizedPicUrl = authorizedPicUrl;
    }
    public String getLockStatus() {

        if(state == 1){
            return "开锁成功";
        }
        return "连接失败";
    }
    public void setLockStatus(String lockStatus) {
        this.lockStatus = lockStatus;
    }
    public String getlockTime() {
        return lockTime.substring(5,16).replace("T"," ");
    }
    public void setLockTime(String lockTime) {
        this.lockTime = lockTime;
    }

    public int getMemberType() {
        return memberType;
    }
    public void setMemberType(int memberType) {
        this.memberType = memberType;
    }
    public int getState(){
        return state;
    }
    public void setState(int state){
        this.state = state;
    }
    public boolean isRoot(){
        return memberType ==0;
    }
}
